import request from '@/utils/request'

// 部门数据
export interface DeptData {
    id?: number;
    name?: string;
    sort?: number;
    sysUserId?: number;
    parentId?: number;
    status?: number;
}

// 查询参数
export interface DeptParams extends Partial<DeptData> {
    startDate?: string;
    endDate?: string;
}

// 岗位列表
export function treeDept(params: DeptParams) {
    return request<DeptData[]>('get', '/dept/tree', { params })
}

// 新增岗位
export function saveDept(data: DeptData) {
    return request('post', '/dept', data)
}

// 修改岗位
export function updateDept(data: DeptData) {
    return request('put', '/dept', data)
}

// 删除岗位
export function deleteDept(ids: any) {
    return request('delete', '/dept/' + ids)
}
